<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <script src="./lib/vue.js"></script>
    <title>Document</title>
</head>
<body>
    <div id="app">
        <div>
            id: <input type="text" v-model="userID">
            name: <input type="text" v-model="userName">
            <input type="button" value="添加" @click="add()">
        </div>
        <p v-for="(item,input) in listArray" v-bind:key="item.id">
            <input type="checkbox">
            {{item.id}}-------{{item.name}}
        </p>
    </div>
</body>
<script>
    var vm = new Vue({
        el:'#app',
        userID:0,
        userName:'',
        data:{
            listArray:[
                {id:1,name:'姚超慧'},
                {id:2,name:'褚可可'},
                {id:3,name:'贾雅静'},
                {id:4,name:'毛龙珠'},
                {id:5,name:'姚超慧是你们的'},
            ]
        },
        methods:{
            add(){
                this.listArray.unshift({
                    id:this.userID,
                    name:this.userName
                })
            }
        },
    })
</script>
</html>